<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Code Igniter
 *
 * An open source application development framework for PHP 4.3.2 or newer
 *
 * @package		CodeIgniter
 * @author		Rick Ellis
 * @copyright	Copyright (c) 2006, pMachine, Inc.
 * @license		http://www.codeignitor.com/user_guide/license.html
 * @link		http://www.codeigniter.com
 * @since		Version 1.0
 * @filesource
 */

// ------------------------------------------------------------------------

/**
 * Code Igniter Config Class
 *
 * This class contains functions that enable config files to be managed
 *
 * @package		CodeIgniter
 * @subpackage	Libraries
 * @category	Libraries
 * @author		Rick Ellis
 * @link		http://www.codeigniter.com/user_guide/libraries/config.html
 */
class MY_Config extends CI_Config {


	var $config = array();
	var $is_loaded = array();
	
	// --------------------------------------------------------------------

	/**
	 * Site URL
	 *
	 * @access	public
	 * @param	string	the URI string
	 * @return	string
	 */		
	function site_url($uri = '',$lng='')
	{
		if (is_array($uri))
		{
			$uri = implode('/', $uri);
		}
		
		$lng= (!empty($lng)) ? $lng.'/' : $this->slash_item('language');
		
		if ($uri == '')
		{
			return $this->slash_item('base_url').$this->slash_item('index_page').$lng;
		}
		else
		{
			$suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');		
			return $this->slash_item('base_url').$this->slash_item('index_page').$lng.preg_replace("|^/*(.+?)/*$|", "\\1", $uri).$suffix;
		}
	}

}

// END CI_Config class
?>
